package com.laizhenghua.payment.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @description:
 * @date: 2022/1/3 19:03
 */
@RestController
@RequestMapping(value = "/payment")
public class PaymentController {
    @Value(value = "${server.port}")
    private String serverPort;

    @RequestMapping(value = "/hello", method = RequestMethod.GET)
    public String hello() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date = sdf.format(new Date());
        return date + " Hello Consul Server Port: " + serverPort;
    }
}
